import echarts from "echarts"
export default {
    textStyle:{
        color:'#fff'
    },
    title:{
        text:'单位：个',
        left:20,
        top:30,
        textStyle:{
            color:'#fff',
            fontSize:14,
        }
    },
    grid: {
        left: 20,
        right: 20,
        bottom: 20,
        containLabel: true
    },
    xAxis: {
        type: 'value',
        // boundaryGap: [0, 0.01],
        splitLine:{show: false},
        axisLine:{
            lineStyle:{
                color:'#EEEBE9'
            }
        } 
    },
    yAxis: {
        type: 'category',
        data: ['上月','本月'],
        splitLine:{show: false},
        axisLine:{
            lineStyle:{
                color:'#EEEBE9'
            }
        } 
    },
    series: [
        {
            name: '2011年',
            type: 'bar',
            barWidth:16,
            data: [636,757],
            itemStyle: {
                normal: {
                    color: (params)=>{
                        const colors=[
                            [
                                {
                                    offset: 0,
                                    color: "#04FDCB" // 0% 处的颜色
                                }, {
                                    offset: 1,
                                    color: "#03B1D3" // 100% 处的颜色
                                }
                            ],
                            [{
                                offset: 0,
                                color: "#E69A12" // 0% 处的颜色
                            },{
                                offset: 1,
                                color: "#0CBA89" // 100% 处的颜色
                            }]
                        ]
                        return new echarts.graphic.LinearGradient(0, 0, 1, 0, colors[params.dataIndex], false)
                    }
                }
            }
        }
    ]
};